﻿using PolePositionDesktop.WebService;
using GoogleEarthClasses.Global;
using System.IO;
using System.Text.RegularExpressions;
using System.Configuration;

namespace PolePositionDesktop
{
    public static class WebServiceManager
    {
        public static string GetLastVersion()
        {
            WebService.Service1 _WebService;
            _WebService = new Service1();
            return  _WebService.GetLastVersion();
        }
        public static string[] GetColors()
        {
            WebService.Service1 _WebService;
            _WebService = new Service1();
            return _WebService.GetColors();
        }
        public static void DownloadImage( int PositionId, int ImageId, string NewThumbnailName)
        {
            byte[] _newThumbailBuffer;

            WebService.Service1 WebService = new Service1();
            _newThumbailBuffer = WebService.GetThumbails(PositionId, ImageId , Constants.k_ThumbailWidth);
            GImages.SaveImage(_newThumbailBuffer, NewThumbnailName);

            System.Threading.Thread.Sleep(ConvertHelper.ToInt32(ConfigurationManager.AppSettings["TimeWaitUpImages"]));
        }
    }
}
